﻿#region File Info Header
/*________________________________________________________________________________________

  Copyright (C) 2011 Jason Zhang, eagleboost@msn.com

  * THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, 
  * EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED 
  * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.

________________________________________________________________________________________*/
#endregion File Info Header

namespace EagleBoost.Wpf.Infra.Extensions
{
  using System.Text.RegularExpressions;

  /// <summary>
  /// Extension methods for Regex
  /// </summary>
  public static class RegexExtension
  {
    /// <summary>
    /// Check if the input is exactly matched with the regex
    /// </summary>
    /// <param name="regex"></param>
    /// <param name="input"></param>
    /// <returns></returns>
    public static bool IsExactMatch(this Regex regex, string input)
    {
      return regex.Match(input).Groups[0].Value == input;
    }
  }
}
